/*
 * @Author: qianmingtian
 * @Date: 2020-07-10 09:15:15
 * @LastEditors: qianmingtian
 * @LastEditTime: 2020-07-10 10:01:17
 * @FilePath: \qianmingtian.github.io\code\java\ExceptionTest\ExceptionTest01.java
 */
package ExceptionTest;

import java.security.DomainLoadStoreParameter;

public class ExceptionTest01 {

    public static void main(String[] args) {
        // ClassNotFoundException 是编译时异常，必须编写时处理，否则编译器会报错
        // doSome();

        // NullPointerException n = new NullPointerException();
        // n.getMessage();
        // // 异步处理
        // n.printStackTrace();;
        // System.out.println(m());
        System.out.println(m());

    }

    // throws 给上一级，上一级可以try/catch自己处理，或者throws传给上一级处理
    public static void doSome() throws ClassNotFoundException {

    }
    public static int m(){
        int i = 100;
        try{
            return i;
        }finally{
            i++;
        }
    }
}/*
  * @Author: qianmingtian
  * 
  * @Date: 2020-07-10 09:15:15
  * 
  * @LastEditors: qianmingtian
  * 
  * @LastEditTime: 2020-07-10 09:15:15
  * 
  * @FilePath:
  * \qianmingtian.github.io\code\java\ExceptionTest\ExceptionTest01.java
  */
